package org.example.seata.bs.api.feign.account.fallback;

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.example.seata.bs.api.dto.account.AccountBalanceLogDto;
import org.example.seata.bs.api.feign.account.RemoteAccountService;
import org.example.seata.bs.api.vo.account.AccountBalanceLogVo;
import org.example.seata.bs.api.vo.account.AccountVo;
import org.example.seata.common.core.util.ApiResp;

/**
 * @author hzq
 * @date 2021/11/30 16:22
 */
@Slf4j
public class RemoteAccountServiceFallbackImpl implements RemoteAccountService {

    @Setter
    private Throwable cause;

    @Override
    public ApiResp<AccountBalanceLogVo> minusAccountBalance(AccountBalanceLogDto dto) {
        log.error("减用户余额失败:{}", cause);
        return ApiResp.ofFeignError(cause);
    }

    @Override
    public ApiResp<AccountVo> getInfo() {
        log.error("获取用户信息失败:{}", cause);
        return ApiResp.ofFeignError(cause);
    }

    @Override
    public ApiResp putInfo(String from) {
        log.error("获取用户信息失败:{}", cause);
        return ApiResp.ofFeignError(cause);
    }
}
